package com.rytx.system.domain.ysp;

import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *  资金明细
 */
public class ArtFundingDetails {
    private Long id; // 主键
    private String orderNo; // 订单号
    private String fundingType; // 资金类型，1-收入（扣款），2-支出（退款）
    private Date fundingDate; // 资金日期
    private BigDecimal fundingAmount; // 资金金额
    private String fundingRemark; // 资金备注
    private String userId; // 用户ID
    private Long artRentalId;  //商品ID
    private String artName;  //商品名称
    private String statisticsDay;  //统计日期
    private String statisticsMonth;  //统计日期
    private String statisticsYear;  //统计日期
    private String groupBy;   //按天分组
    private String tradeNo;   //交易号

    private static final DateFormat dfDay = new SimpleDateFormat("yyyy-MM-dd");
    private static final DateFormat dfMonth = new SimpleDateFormat("yyyy-MM");
    private static final DateFormat dfYear = new SimpleDateFormat("yyyy");

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getGroupBy() {
        return groupBy;
    }

    public void setGroupBy(String groupBy) {
        this.groupBy = groupBy;
    }

    public String getStatisticsDay() {
        return statisticsDay;
    }

    public void setStatisticsDay(String statisticsDay) {
        this.statisticsDay = statisticsDay;
    }

    public String getStatisticsMonth() {
        return statisticsMonth;
    }

    public void setStatisticsMonth(String statisticsMonth) {
        this.statisticsMonth = statisticsMonth;
    }

    public String getStatisticsYear() {
        return statisticsYear;
    }

    public void setStatisticsYear(String statisticsYear) {
        this.statisticsYear = statisticsYear;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getFundingType() {
        return fundingType;
    }

    public void setFundingType(String fundingType) {
        this.fundingType = fundingType;
    }

    public Date getFundingDate() {
        return fundingDate;
    }

    public void setFundingDate(Date fundingDate) {
        if(fundingDate!= null){
            setStatisticsDay(dfDay.format(fundingDate));
            setStatisticsMonth(dfMonth.format(fundingDate));
            setStatisticsYear(dfYear.format(fundingDate));
        }

        this.fundingDate = fundingDate;
    }

    public BigDecimal getFundingAmount() {
        return fundingAmount;
    }

    public void setFundingAmount(BigDecimal fundingAmount) {
        this.fundingAmount = fundingAmount;
    }

    public String getFundingRemark() {
        return fundingRemark;
    }

    public void setFundingRemark(String fundingRemark) {
        this.fundingRemark = fundingRemark;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Long getArtRentalId() {
        return artRentalId;
    }

    public void setArtRentalId(Long artRentalId) {
        this.artRentalId = artRentalId;
    }

    public String getArtName() {
        return artName;
    }

    public void setArtName(String artName) {
        this.artName = artName;
    }

    @Override
    public String toString() {
        return "ArtFundingDetails{" +
                "id=" + id +
                ", orderNo='" + orderNo + '\'' +
                ", fundingType='" + fundingType + '\'' +
                ", fundingDate=" + fundingDate +
                ", fundingAmount='" + fundingAmount + '\'' +
                ", fundingRemark='" + fundingRemark + '\'' +
                ", userId='" + userId + '\'' +
                ", artRentalId=" + artRentalId +
                ", artName='" + artName + '\'' +
                ", statisticsDay='" + statisticsDay + '\'' +
                ", statisticsMonth='" + statisticsMonth + '\'' +
                ", statisticsYear='" + statisticsYear + '\'' +
                '}';
    }
}
